<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title></title>
    <link rel="stylesheet" href="layui/css/layui.css">
</head>

<script src="layui/layui.js"></script>
<style>
    center{
        font-size: 30px;
        color: red;
        margin-top: 35px;
    }
</style>
<body>

<form class="layui-form" action="/file/update">
    <center>修改文档</center>
    <div class="layui-form-item">
        <label class="layui-form-label">文档名称</label>
        <div class="layui-input-block">
            <input value="${data.filename}" type="text" name="filename" required  lay-verify="required" placeholder="请输入标题" autocomplete="on" class="layui-input">
        </div>
    </div>

    <div class="layui-form-item layui-form-text">
        <label class="layui-form-label">摘要</label>
        <div class="layui-input-block">
            <textarea name="digest" value="${data.digest}" placeholder="请输入内容" class="layui-textarea"></textarea>
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">上传人</label>
        <div class="layui-input-block">
            <input value="${data.username}" type="text" name="username" required  lay-verify="required" placeholder="请输入标题" autocomplete="on" class="layui-input">
        </div>
    </div>

    <!-- layui-form-item 一个输入项-->
    <div class="layui-form-item">
        <label class="layui-form-label">上传时间</label>
        <!-- layui-input-block 输入框会占满除文字外的整行 -->
        <div class="layui-input-block">
            <input value="${data.date}" readonly id="birth" type="text" name="date" placeholder="请选择生日日期" autocomplete="off" class="layui-input">
        </div>
    </div>

    <div class="layui-form-item">
        <div class="layui-input-block">
            <button class="layui-btn" lay-submit lay-filter="formDemo">立即提交</button>
            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
        </div>
    </div>

</form>

<script>
    //Demo
    layui.use('form', function(){
        var form = layui.form;

        //监听提交
        form.on('submit(formDemo)', function(data){
            layer.msg(JSON.stringify(data.field));//把表单中数据转成Json并输出
            return true;//true表示执行action对应的地址
        });
    });

    layui.use(["laydate","form"],function(){
        var laydate = layui.laydate;
        //执行一个laydate实例
        laydate.render({
            elem: '#birth', //指定元素
            format:'yyyy/MM/dd',
            //value:'2012-12-12' //默认值
            value:new Date() //默认值
        });
    });
</script>

</body>
</html>